exports.generateModelObject = function (params, dateModel, type) {
    let allField = dateModel.property;
    let updateParams = {};
    for (let key in params) {
        if (allField.hasOwnProperty(key)) {
            updateParams[key] = params[key];
        }
    }
    if (type == 'update'){
        for(let i in dateModel.fixedProp){
            delete updateParams[dateModel.fixedProp[i]];
        }
    }
    return updateParams;
};
exports.getPageParamsSqlStr = function(params) {
    let sql = "";
    if(params.options){
        sql = " limit " + (params.options.skip?params.options.skip:"0") + ","+(params.options.limit?params.options.limit:"10 ");
    }else{
        sql = " limit 0,10 ";
    }
    return sql;
};

